#ifndef DIFFIE_HPP
#define DIFFIE_HPP

#include "cryptoUtil.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <math.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <vector>
#include <cstdlib>
#include "wlan.hpp"
#include "ElGamal.hpp"


typedef struct
{
   WLANAddr address;
   unsigned int p;
   unsigned int g;
   unsigned int public_key;
   double time;
   //PROGTABLE() {address = NULL; p = 0; g = 0; public_key = 0; }

}PROGTABLE;


// readiness states
#define DIFFIE_INIT				1
#define DIFFIE_PG_PUBLICKEY		2
#define DIFFIE_PUBLICKEY		3
#define DIFFIE_SEND				4



// void MySend(char * destAddressStr, char * message) 


int checkProgressTable (WLANAddr *);
unsigned int charToInt (char *);
unsigned int keyMaker (int, int, int);
void initiateDiffie ();
void addToSecureTable (WLANAddr *, unsigned int);
void handleDH ( PCryptoPacket, WLANHeader * );
void sendDiffieCryptoPacket( PCryptoPacket, WLANAddr * );

#endif
